package cn.etynit.mms.feign;

import cn.etynit.domain.Expense;
import cn.etynit.mms.fallback.ExpenseServiceFallbackFactory;
import cn.etynit.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@FeignClient(contextId = "expenseService",value = "service-expense",path = "/expense",fallbackFactory = ExpenseServiceFallbackFactory.class)
public interface ExpenseService {
    @RequestMapping(value="/save",method= RequestMethod.POST)
    JsonResult saveOrUpdate(@RequestBody Expense expense);

    @RequestMapping(value = "/inquireCost/{type}/{userId}/{month}",method = RequestMethod.GET)
    JsonResult inquireCost(@PathVariable("type") Integer type, @PathVariable("userId") Long userId,@PathVariable("month") Integer month);

    @RequestMapping(value = "/adviceCharge",method = RequestMethod.GET)
    JsonResult adviceCharge();
}
